/**
 * a9-nav-bar 组件
 */
export default {
  name: 'a9-nav-bar',
  inheritAttrs: false,
  functional: true,
  render: (h, ctx) =>
    h('van-nav-bar', {
      props: ctx.props,
      listeners: {
        ...ctx.listeners,
        // click-left 默认执行返回操作
        'click-left':
          ctx.listeners['click-left'] || function () {
            let parent = ctx.parent
            while (!parent.$router) {
              parent = parent.$parent
            }
            parent.$router.back()
          }
      },
      scopedSlots: ctx.scopedSlots
    })
}
